<div class="top">
    <div class="content">
        <?php if(!user::$userInfo['uid']){  ?>
            <div class="">
                
                    <span>您好，欢迎您访问就是干咨询网！</span>
                    <div class="t_login">
                        <a href="javascript:;" class="blue" id="login">登录</a> | <a href="javascript:;" id="register">免费注册</a>
                    </div>
                    <!-- 第三方登陆 -->
                    <!-- <div class="t_qw">
                        <a href=""><img src="<?php echo IMG_PATH ?>index/qq.png"></a>
                        <a href=""><img src="<?php echo IMG_PATH ?>index/weixin.png"> </a>
                    </div> -->
            </div>
        <?php }else{ ?>
            <div class="userinfo">
            <span>您好，</span>
            <a href="<?php echo U("user/index") ?>">
                <?php if(isHave(user::$userInfo['username'])){ 
                    echo user::$userInfo['username'] 
                ?>
                <?php    
                }else{
                    echo substr_replace(user::$userInfo['phone'], '****', 3, 4);
                ?>
                <?php } ?>
            </a>
            <span style="color: #ff9027;margin-left: 5px;cursor: pointer;" onclick="window.location.href='<?php echo U("login/loginout") ?>'">【退出】</span>
               <!--  <ul>
                    <li onclick="window.location.href='<?php echo U("user/index") ?>'">个人中心</li>
                    <li onclick="window.location.href='<?php echo U("login/loginout") ?>'">退出登录</li>
                </ul> -->
            <div class="userphone">
                <a href="">
                    <svg t="1535443925203" class="icon" style="fill:#3399fe" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5615" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="25"><path d="M751.036141 162.03542 272.962835 162.03542l0 617.511056 478.073306 0L751.036141 162.03542zM561.799196 112.236224c0-5.477758-4.482081-9.959839-9.959839-9.959839l-99.598392 0c-5.477758 0-9.959839 4.482081-9.959839 9.959839l0 9.959839c0 5.477758 4.482081 9.959839 9.959839 9.959839l99.598392 0c5.477758 0 9.959839-4.482081 9.959839-9.959839L561.799196 112.236224zM512 899.064546c21.912056 0 39.839357-17.927301 39.839357-39.839357s-17.927301-39.839357-39.839357-39.839357c-21.912056 0-39.839357 17.927301-39.839357 39.839357S490.087944 899.064546 512 899.064546zM751.036141 958.823582 272.962835 958.823582c-32.867572 0-59.759035-26.891464-59.759035-59.759035L213.2038 122.196063c0-32.867572 26.891464-59.759035 59.759035-59.759035l478.073306 0c32.867572 0 59.759035 26.891464 59.759035 59.759035l0 776.868483C810.795177 931.932118 783.903713 958.823582 751.036141 958.823582z" p-id="5616"></path></svg>
                    扫描登录手机端
                </a>
                <img src="<?php echo IMG_PATH ?>index/code.jpg"/>
            </div>
        </div>
        <?php } ?>    
        <div class="top_rg">
            <!-- <a href="javascript:;" onclick="goRecords();">行情趋势</a>
            | -->
            <a href="javascript:;" onclick="goCenter();">个人中心</a>
            |
            <a href="<?php echo U('index') ?>">网站首页</a>
            |
            <a href="<?php echo U('service/contact') ?>">联系我们</a>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $(".usercenter,.userphone").mouseover(function (){
            $(this).addClass("an");
        }).mouseout(function(){
            $(this).removeClass("an");
        });
    });

    function goCenter() {
        var isLogin = "<?php echo isHave(user::$userInfo['uid']) ? 1 : 2; ?>";
        var refer_url = "<?php echo U('user/index') ?>";
        if(isLogin == 2) {
            $("#login").click();
            $('#refer').val(encodeURIComponent(refer_url));
            return false;
        }else{
            window.location.href = refer_url;
        }
    }
</script>